<template>
	<div>
		<nav-bar title="设置"></nav-bar>
		<view class="section-2" :style="{'margin-top':navHeight+'px'}">
			<view class="menu-item" @click.stop="cell_Act(1)">
				<view>账户安全</view>
				<image class="arrow" src="https://oss.jxhecong.com/v2/image/arrow_gray@2x.png"></image>
			</view>
		</view>
		<view class="section-2">
			<view class="menu-item" @click.stop="menu_Click(1)">
				<view>用户协议</view>
				<image class="arrow" src="https://oss.jxhecong.com/v2/image/arrow_gray@2x.png"></image>
			</view>
			<view class="menu-item" @click.stop="version_Click">
				<view>版本信息</view>
				<image class="arrow" src="https://oss.jxhecong.com/v2/image/arrow_gray@2x.png"></image>
			</view>
		</view>
		<view class="logot" @click.stop="logot">退出登录</view>
	</div>
</template>

<script>
	var globalData = getApp({
		allowDefault: true
	}).globalData
	import navBar from '../components/navBar.vue'
	export default {
		components:{navBar},
		data(){
			return{
				navHeight:0
			}
		},
		onLoad() {
			console.log("333333")
			this.navHeight = globalData.titleHeight;
			// #ifdef APP-PLUS || APP-NVUE
			plus.navigator.setStatusBarStyle('light');
			// #endif
		},
		onShow() {
			// #ifdef APP-PLUS || APP-NVUE
			plus.navigator.setStatusBarStyle('light');
			// #endif
		},
		methods:{
			cell_Act(type){
				if(type==1){
					uni.navigateTo({
						url:'/pages/me/modifyPwd'
					})
				}
			},
			
			// 版本信息
			version_Click(){
				uni.navigateTo({
					url:'/pages/me/versionInfo'
				})
			},
			menu_Click(){
				uni.navigateTo({
					url:'/pages/login/protocol?url=https://oss.jxhecong.com/app/userAgreement.html'
				})
			},
			logot(){
				uni.showModal({
					title:'提示',
					content:'确定要退出登录?',
					success: (res) => {
						if(res.confirm){
							uni.removeStorageSync('userInfo');
							uni.reLaunch({
								url:'/pages/login/login'
							})
						}
					}
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.menu-item{
		display: flex;
		flex-direction: row;
		justify-content: space-between;
		align-items: center;
		background-color: white;
		height: 57px;
		color: #333333;
		font-size: 14px;
		border-bottom: solid 1rpx #DDDDDD;
	}
	.menu-item:last-child{
		border-bottom-width: 0px;
	}
	.arrow{
		width: 12px;
		height: 12px;
	}
	
	.section-2{
		margin-top: 12px;
		padding: 0px 15px;
		background-color: white;
	}
	.line{
		height: 1px;
		background-color: #DDDDDD;
	}
	.logot{
		position: fixed;
		left:30rpx;
		right:30rpx;
		bottom:30rpx;
		background: #6ABF6C;
		box-shadow: 0px 1px 2px 0px rgba(8, 139, 120, 0.3);
		height:90rpx;
		border-radius:45rpx;
		text-align: center;
		font-size:36rpx;
		font-weight: bold;
		line-height:90rpx;
		color:#FFFFFF;
	}
</style>
